/**
 * 商家管理相关接口
 */
import request from '@/utils/request'

/**
 * 获取商家列表
 * @param {*} query
 */
export function listBusiness(query) {
  return request({
    url: '/business/list',
    method: 'get',
    params: query
  })
}

/**
 * 删除商家
 * @param {*} data
 */
export function deleteBusiness(data) {
  return request({
    url: '/business/del/' + data,
    method: 'delete'
  })
}

/**
 * 新增商家接口
 * @param {*} data
 */
export function addBusiness(data) {
  return request({
    url: '/business/create',
    method: 'post',
    data
  })
}

/**
 * 获取商家详细信息
 * @param {*} id 商家id
 */
export function detailBusiness(id) {
  return request({
    url: '/business/detail',
    method: 'get',
    params: {id}
  })
}

/**
 * 更新商家信息
 * @param {*} data
 */
export function editBusiness(data) {
  return request({
    url: 'business/update',
    method: 'post',
    data
  })
}

/**
 * 获取商家分类，以及品牌商
 */
export function listCatAndBrand() {
  return request({
    url: '/business/catAndBrand',
    method: 'get'
  })
}
